package com.haois.mp.wechat.job;

import com.haois.mp.wechat.common.JobLogCollect;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.IJobHandler;
import com.xxl.job.core.handler.annotation.JobHandler;
import com.haois.mp.wechat.task.VehiclePeccancyTask;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * description
 *
 * @author RuiHaoZ on GuangZhou
 * @date 2018/10/29 20:34
 */
@JobHandler(value = "driverFenUpdateJobHandler")
@Component
public class DriverFenUpdateJobHandler extends IJobHandler {
    @Autowired
    private VehiclePeccancyTask vehiclePeccancyTask;

    @Override
    public ReturnT<String> execute(String s) throws Exception {
        Map<String, Object> params = vehiclePeccancyTask.driverFenUpdate();
        String msg = JobLogCollect.log(params);
        SUCCESS.setMsg(msg);
        return SUCCESS;
    }
}
